<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/index.css"/>
    <title>密码找回</title>
</head>
<body>
<jsp:include page="common/header.jsp"/>
<article>
    <!-- 网站主体 -->
    <div id="main">
        <section class="ct">
            <div class="upload">
                <h1>修改密码</h1>
                <form class="ppp" action="${pageContext.request.contextPath}/password/modify" method="post">
                    <p>
                        <label>旧密码：</label>
                        <input class="upt" type="password" name="oldPassWord" value="" placeholder="请输入原密码"/>
                        <em>${requestScope.oldPassWord}</em>
                    </p>
                    <p>
                        <label>新密码：</label>
                        <input class="upt" type="password" name="newPassWord" value="" placeholder="请输入新密码"/>
                        <em>${requestScope.newPassWord}</em>
                        <span class="source-tag-msg">密码长度为6~20</span>
                    </p>
                    <p>
                        <label>确认密码：</label>
                        <input class="upt" type="password" name="confirmPassWord" value="" placeholder="请再次输入新密码"/>
                        <em>${confirmPassWord}</em>
                        <span class="source-tag-msg">两次输入的密码必须保持一致</span>
                    </p>

                    <p><label class="btn"><a class="btn" onclick="changePassWord()">确认修改</a></label></p>
                </form>
            </div>
        </section>
    </div>
</article>
<jsp:include page="common/footer.jsp"/>
</body>
<script>
    function changePassWord(){
        let oldPassWord = $("input[name=oldPassWord]").val();
        let newPassWord = $("input[name=newPassWord]").val();
        let confirmPassWord = $("input[name=confirmPassWord]").val();
        if (oldPassWord.length >=6 && newPassWord.length >= 6 ){
           $(".ppp").submit();
        }
    }
</script>
</html>
